<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:87:"E:\phpStudy20161103\WWW\tpAdmin-master\public/../application/admin\view\user\index.html";i:1490248760;}*/ ?>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <link rel="Bookmark" href="/favicon.ico" >
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/static/admin/lib/html5.js"></script>
    <script type="text/javascript" src="/static/admin/lib/respond.min.js"></script>
    <script type="text/javascript" src="/static/admin/lib/PIE_IE678.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/static/admin/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/static/admin/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/static/admin/lib/Hui-iconfont/1.0.7/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/static/admin/lib/icheck/icheck.css" />
    <link rel="stylesheet" type="text/css" href="/static/admin/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="/static/admin/h-ui.admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="/static/admin/css/app.css" />
    <title>tpAdmin</title>
</head>
<body>
    <table class="table table-border table-bordered table-hover table-bg mt-20">
        <thead>
        <tr class="text-c">
            <th width="25"><input type="checkbox" value="" name=""></th>
            <th width="50">ID</th>
            <th width="100">昵称</th>
            <th width="100">姓名</th>
            <th width="150">邮箱</th>
            <th width="60">状态</th>
            <th width="80">备注</th>
            <th width="150">操作</th>
        </tr>
        </thead>
        <tbody>
        <?php echo $data; ?>
        </tbody>
    </table>
<hr/>
    <!--修改密码  start-->
    <div class="page-container" id="password" style="display: block;">
        <form class="form form-horizontal" id="password_form" method="post" action="/admin/user/password">
            <input type="hidden" name="userid" value="3">
            <div class="row cl">
                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>新密码：</label>
                <div class="formControls col-xs-6 col-sm-6">
                    <input type="password" class="input-text" placeholder="请填写6-32位任意字符" name="password" datatype="/^[\w\W]{6,32}$/" nullmsg="请填写密码" errormsg="请填写6-32位任意字符">
                </div>
                <div class="col-xs-3 col-sm-3"><span class="Validform_checktip"></span></div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>重复密码：</label>
                <div class="formControls col-xs-6 col-sm-6">
                    <input type="password" class="input-text" placeholder="请填写6-32位任意字符" name="repassword" datatype="/^[\w\W]{6,32}$/" nullmsg="请填写密码" errormsg="两次输入的密码不一致" recheck="password">
                </div>
                <div class="col-xs-3 col-sm-3"><span class="Validform_checktip"></span></div>
            </div>

            <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                    <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                    <button type="button" class="btn btn-default radius ml-20" onclick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
                </div>
            </div>
        </form>
    </div>
    <!--修改密码 end-->
    <hr/>
    <!--添加 start-->
    <div class="page-container" id="edit" style="display: block;">添加
        <form class="form form-horizontal" id="edit_form" method="post" action="/admin/user/add">
            <div class="row cl">
                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>昵称：</label>
                <div class="formControls col-xs-6 col-sm-6">
                    <input type="text" class="input-text" placeholder="只能是字母数字下划线" name="nickname" datatype="/\w+/" nullmsg="请填写帐号" errormsg="帐号只能是字母数字下划线">
                </div>
                <div class="col-xs-3 col-sm-3"><span class="Validform_checktip"></span></div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>姓名：</label>
                <div class="formControls col-xs-6 col-sm-6">
                    <input type="text" class="input-text" value="" placeholder="" name="rename" datatype="*" nullmsg="请填写姓名">
                </div>
                <div class="col-xs-3 col-sm-3"><span class="Validform_checktip"></span></div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>密码：</label>
                <div class="formControls col-xs-6 col-sm-6">
                    <input type="password" class="input-text" placeholder="请填写6-32位任意字符" name="password" datatype="/^[\w\W]{6,32}$/" nullmsg="请填写密码" errormsg="请填写6-32位任意字符">
                </div>
                <div class="col-xs-3 col-sm-3"><span class="Validform_checktip"></span></div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3 col-sm-3">邮箱：</label>
                <div class="formControls col-xs-6 col-sm-6">
                    <input type="text" class="input-text" value="" placeholder="" name="email" datatype="e" ignore="ignore" errormsg="邮箱格式错误">
                </div>
                <div class="col-xs-3 col-sm-3"><span class="Validform_checktip"></span></div>
            </div>
    </div>
    <div class="row cl">
        <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
            <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
            <button type="reset" class="btn btn-default radius ml-20">&nbsp;&nbsp重置&nbsp;&nbsp;</button>
        </div>
    </div>
    </form>
    </div>
    <!--添加 end-->
    <hr/>
    <!--编辑 start-->
    <div class="page-container" id="edit" style="display: block;">编辑
        <form class="form form-horizontal" id="edit_form" method="post" action="">
            <input type="hidden" name="userid" value="3">
            <div class="row cl">
                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>昵称：</label>
                <div class="formControls col-xs-6 col-sm-6">
                    <input type="text" class="input-text" placeholder="只能是字母数字下划线" name="nickname" datatype="/\w+/" nullmsg="请填写帐号" errormsg="帐号只能是字母数字下划线">
                </div>
                <div class="col-xs-3 col-sm-3"><span class="Validform_checktip"></span></div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>姓名：</label>
                <div class="formControls col-xs-6 col-sm-6">
                    <input type="text" class="input-text" value="" placeholder="" name="rename" datatype="*" nullmsg="请填写姓名">
                </div>
                <div class="col-xs-3 col-sm-3"><span class="Validform_checktip"></span></div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>密码：</label>
                <div class="formControls col-xs-6 col-sm-6">
                    <input type="password" class="input-text" placeholder="请填写6-32位任意字符" name="password" datatype="/^[\w\W]{6,32}$/" nullmsg="请填写密码" errormsg="请填写6-32位任意字符">
                </div>
                <div class="col-xs-3 col-sm-3"><span class="Validform_checktip"></span></div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3 col-sm-3">邮箱：</label>
                <div class="formControls col-xs-6 col-sm-6">
                    <input type="text" class="input-text" value="" placeholder="" name="email" datatype="e" ignore="ignore" errormsg="邮箱格式错误">
                </div>
                <div class="col-xs-3 col-sm-3"><span class="Validform_checktip"></span></div>
            </div>
            </div>
            <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                    <button type="submit" class="btn btn-primary radius edit">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                    <button type="reset" class="btn btn-default radius ml-20">&nbsp;&nbsp重置&nbsp;&nbsp;</button>
                </div>
            </div>
        </form>
    </div>
    <script type="text/javascript" src="/static/admin/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript">
        $('.edit').click(function(){
            var str_data = $("#edit_form input").map(function(){
                return ($(this).attr("name")+'='+$(this).val());
            }).get().join("&");
//            alert(str_data);
            $.ajax({
                type:"POST",
                url:"/admin/user/edit",
                data:{param:str_data},
                dataType:'json',
                success:function(data){
//                    console.log(data);
                    alert(data);
//                    if(data == 1){
//                        window.location.href = 'admin/user/index';
//                    }else{
//                        alert(data);
//                    }
                }
            });
        });
    </script>
    <!--编辑 end-->

</body>
</html>